import { defineStore } from "pinia";

export const useAppStore = defineStore(`${import.meta.env.VITE_APP_TERRACE}-app`, {
  state: () => ({
    isRouterAlive: true
  }),
  getters: {
    getSpaceList: (state) => {
      return state.spaceList;
    }
  },
  actions: {
    chanegSpaceList(list) {
      this.spaceList = list;
    }
  },
  persist: {
    enabled: true,
    strategies: [
      {
        storage: sessionStorage,
        paths: ["isRouterAlive"]
      }
    ]
  }
});
